home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_15137.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  21 lines

  1. -- card: 15137 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10.     int     age;
  11.     int     weight;
  12.  
  13. These statements declare the instance variables age and weight to be of TYPE int            (integer).  The remaining data types offered in C are char (character) and float             (floating-point number), as well as larger and higher-precision kinds of integer and floating-point variables.
  14.  
  15. A note about usage in this document:  a DEFINITION is something which describes the structure of or allocates space for something, whereas a DECLARATION simply identifies the thing so the compiler is not confused.  A struct expression may be thought of as "declaring" the instance variables and methods of a class.  However, although no space is yet allocated for a Person object, the struct expression "defines" the Person class by describing its structure.  (Definitions are usually implicitly declarations, while declarations need not define anything.)
  16.  
  17. Notice that a semicolon terminates simple C statements like the declaration 'int age;'.  A compound statement like a function body is enclosed by {} braces and is not followed
  18.  
  19. -- part contents for background part 7
  20. ----- text -----
  21. 22